/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.woundedwolf.android.tumbleweed.examples;

import com.woundedwolf.android.tumbleweed.Engine;
import com.woundedwolf.android.tumbleweed.AbstractGame;
import com.woundedwolf.android.tumbleweed.Polygon;
import com.woundedwolf.android.tumbleweed.renderables.Polygons;
import com.woundedwolf.android.tumbleweed.elements.ActionVector;
import com.woundedwolf.android.tumbleweed.elements.Vector2D;
import java.util.ArrayList;
import javax.microedition.khronos.opengles.GL10;

/**
 *
 * @author zagnut
 */
public class TouchDraw extends AbstractGame
{

        private Polygons polys;
        private Polygon p;

        public TouchDraw(Engine engine)
        {
                super(engine);
		polys = new Polygons();
		addRenderable(polys);
        }


	public void updateGame()
	{
		ActionVector x = dequeueAction();
		if (x != null)
		{
			p = new Polygon(GL10.GL_LINES, 10);
			p.addPoint(new Vector2D(x.getXpos(), x.getYpos()));
                        polys.addPolygon(p);
		}
	}
}
